package org.codegallery.dynawebappgal.service.impl;

import java.io.Serializable;
import java.util.List;

import org.codegallery.dynawebappgal.dao.GenericDAO;
import org.codegallery.dynawebappgal.service.GenericService;

public class GenericServiceImpl<T, ID extends Serializable> implements GenericService<T, ID>{
	protected GenericDAO<T, ID> dao;
	
	public GenericDAO<T, ID> getDao() {
		return dao;
	}

	public void setDao(GenericDAO<T, ID> dao) {
		this.dao = dao;
	}

	public T findById(ID id, boolean lock){
		return dao.findById(id, lock);
	}
    
    public List<T> findAll(){
    	return dao.findAll();
    }
 
//    List<T> findByExample(T exampleInstance);
 
    public T makePersistent(T entity){
    	return dao.makePersistent(entity);
    }
 
    public void makeTransient(T entity){
    	 dao.makeTransient(entity);
    }
}
